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

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

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

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

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

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

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

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

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

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

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

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

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