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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.o: E = None
        self.q: E = None
        self.txt = txt

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

m = A("m")
f = B("f")
d = C("d")
a = D("a")
c = E("c")
b = F("b")
l = F("l")
e = C("e")
n = E("n")

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.o: E = None
        self.q: E = None
        self.txt = txt

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

m = A("m")
f = B("f")
d = C("d")
a = D("a")
c = E("c")
b = F("b")
l = F("l")
e = C("e")
n = E("n")

m.t = f
m.w = l
f.s = n
f.v = b
f.r = l
f.q = d
f.p = m
d.p = a
d.o = e
a.y = b
c.u = m
c.z = b
c.o = n
c.q = n
b.q = l
b.z = e
b.x = m
b.s = m
l.q = b
l.z = d
l.x = m
l.s = m
e.p = a
e.o = d
n.u = m
n.z = b
n.o = c
n.q = c
assert c.u.t.p.txt == "m"