#include <iostream>
#include <fstream>
#include <string>
int main()
{
try {
std::ifstream fs("ファイル名.txt");
if (!fs)
throw std::exception();
std::string line;
std::getline(fs, line);
if (line.empty())
throw std::exception();
std::ifstream fs2(line);
if (!fs2)
throw std::exception();
std::getline(fs2, line);
std::cout << line << std::endl;
} catch (std::exception& e) {
return -1;
}
return 0;
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGZzdHJlYW0+CiNpbmNsdWRlIDxzdHJpbmc+CgppbnQgbWFpbigpCnsKCXRyeSB7CgkJc3RkOjppZnN0cmVhbSBmcygi44OV44Kh44Kk44Or5ZCNLnR4dCIpOwoJCWlmICghZnMpCgkJCXRocm93IHN0ZDo6ZXhjZXB0aW9uKCk7CgkJCQoJCXN0ZDo6c3RyaW5nIGxpbmU7CgkJc3RkOjpnZXRsaW5lKGZzLCBsaW5lKTsKCQlpZiAobGluZS5lbXB0eSgpKQoJCQl0aHJvdyBzdGQ6OmV4Y2VwdGlvbigpOwoJCQkKCQlzdGQ6Omlmc3RyZWFtIGZzMihsaW5lKTsKCQlpZiAoIWZzMikKCQkJdGhyb3cgc3RkOjpleGNlcHRpb24oKTsKCQkJCgkJc3RkOjpnZXRsaW5lKGZzMiwgbGluZSk7CgkJc3RkOjpjb3V0IDw8IGxpbmUgPDwgc3RkOjplbmRsOwoJCQoJfSBjYXRjaCAoc3RkOjpleGNlcHRpb24mIGUpIHsKCQlyZXR1cm4gLTE7Cgl9CglyZXR1cm4gMDsKfQ==