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

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

h.o = d
j.p = e
j.v = n
k.o = b
k.p = e
c.u = j
c.t = d
c.x = h
c.y = b
c.z = b
c.o = k
b.z = g
b.u = g
b.r = c
b.p = c
g.x = d
g.v = k
g.t = e
n.o = b
n.p = e
d.u = e
d.t = c
d.x = h
d.y = b
d.z = b
d.o = m
e.p = j
e.v = n
m.o = b
m.p = e
assert d.x.o.o.o.z.t.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

h.o = d
j.p = e
j.v = n
k.o = b
k.p = e
c.u = j
c.t = d
c.x = h
c.y = b
c.z = b
c.o = k
b.z = g
b.u = g
b.r = c
b.p = c
g.x = d
g.v = k
g.t = e
n.o = b
n.p = e
d.u = e
d.t = c
d.x = h
d.y = b
d.z = b
d.o = m
e.p = j
e.v = n
m.o = b
m.p = e
assert d.x.o.o.o.z.t.v.p.txt == "e"