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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: E = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.y: C = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

n = A("n")
f = B("f")
h = C("h")
g = D("g")
l = E("l")
m = F("m")
j = B("j")
d = B("d")
k = C("k")
c = D("c")

n.o = d
n.p = m
f.q = g
f.y = l
f.x = k
h.t = c
g.w = m
g.q = h
g.y = k
g.z = c
g.p = c
l.z = j
m.q = k
m.t = k
m.o = k
m.x = g
m.u = g
j.q = g
j.y = l
j.x = k
d.q = c
d.y = l
d.x = h
k.t = c
c.w = m
c.q = k
c.y = k
c.z = g
c.p = g
assert c.w.t.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: E = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.y: C = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

n = A("n")
f = B("f")
h = C("h")
g = D("g")
l = E("l")
m = F("m")
j = B("j")
d = B("d")
k = C("k")
c = D("c")

n.o = d
n.p = m
f.q = g
f.y = l
f.x = k
h.t = c
g.w = m
g.q = h
g.y = k
g.z = c
g.p = c
l.z = j
m.q = k
m.t = k
m.o = k
m.x = g
m.u = g
j.q = g
j.y = l
j.x = k
d.q = c
d.y = l
d.x = h
k.t = c
c.w = m
c.q = k
c.y = k
c.z = g
c.p = g
assert c.w.t.t.w.txt == "m"