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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: C = None
        self.w: C = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: A = None
        self.x: B = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: A = None
        self.s: B = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.v: B = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: C = None
        self.w: C = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: A = None
        self.x: B = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: A = None
        self.s: B = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.v: B = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

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