class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: D = None
        self.s: C = None
        self.t: C = None
        self.p: D = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: D = None
        self.r: B = None
        self.x: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.y: A = None
        self.z: B = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: C = None
        self.s: C = None
        self.w: C = None
        self.x: D = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

l = A("l")
f = B("f")
h = C("h")
d = D("d")
j = E("j")
n = F("n")
m = F("m")
e = B("e")
i = C("i")

l.q = n
l.r = d
l.p = d
l.s = i
l.t = i
l.x = m
f.o = m
h.u = d
h.z = d
h.r = f
h.x = j
h.p = e
d.q = i
d.p = f
d.z = f
d.y = l
d.v = e
d.r = j
j.y = l
j.u = i
j.s = i
j.w = i
j.x = d
j.o = f
n.x = h
m.x = i
e.o = n
i.u = d
i.z = d
i.r = f
i.x = j
i.p = e
assert f.o.x.x.o.o.x.u.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: D = None
        self.s: C = None
        self.t: C = None
        self.p: D = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: D = None
        self.r: B = None
        self.x: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.y: A = None
        self.z: B = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: C = None
        self.s: C = None
        self.w: C = None
        self.x: D = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

l = A("l")
f = B("f")
h = C("h")
d = D("d")
j = E("j")
n = F("n")
m = F("m")
e = B("e")
i = C("i")

l.q = n
l.r = d
l.p = d
l.s = i
l.t = i
l.x = m
f.o = m
h.u = d
h.z = d
h.r = f
h.x = j
h.p = e
d.q = i
d.p = f
d.z = f
d.y = l
d.v = e
d.r = j
j.y = l
j.u = i
j.s = i
j.w = i
j.x = d
j.o = f
n.x = h
m.x = i
e.o = n
i.u = d
i.z = d
i.r = f
i.x = j
i.p = e
assert f.o.x.x.o.o.x.u.p.o.txt == "m"