class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: A = None
        self.o: C = None
        self.t: F = None
        self.w: F = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: C = None
        self.u: C = None
        self.p: D = None
        self.y: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: A = None
        self.o: C = None
        self.t: F = None
        self.w: F = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: C = None
        self.u: C = None
        self.p: D = None
        self.y: A = None
        self.t: A = None
        self.txt = txt

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

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

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