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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: D = None
        self.r: D = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: F = None
        self.r: A = None
        self.w: F = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: E = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: D = None
        self.r: D = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: F = None
        self.r: A = None
        self.w: F = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: E = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: F = None
        self.txt = txt

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

m.p = b
j.w = b
j.q = k
j.r = k
j.v = m
g.w = e
g.x = e
g.t = e
g.u = a
g.p = n
g.y = d
k.u = e
k.p = b
k.q = b
k.r = m
k.w = n
a.o = e
a.w = e
a.t = n
b.v = a
b.s = n
d.w = e
d.t = e
d.u = e
d.x = a
d.p = n
d.y = g
e.o = a
e.w = a
e.t = n
n.v = a
n.s = b
assert e.t.v.t.v.o.o.w.o.t.txt == "n"