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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: C = None
        self.z: E = None
        self.r: C = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: C = None
        self.z: E = None
        self.r: C = None
        self.o: C = None
        self.txt = txt

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

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