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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: B = None
        self.x: B = None
        self.u: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: B = None
        self.x: B = None
        self.u: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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