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

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

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

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

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

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

e.u = n
e.t = n
g.v = i
m.u = n
k.u = m
k.o = g
k.y = i
l.v = b
d.v = k
b.u = i
b.y = i
b.o = g
i.u = n
n.u = e
n.t = e
assert b.o.v.u.u.u.t.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

e.u = n
e.t = n
g.v = i
m.u = n
k.u = m
k.o = g
k.y = i
l.v = b
d.v = k
b.u = i
b.y = i
b.o = g
i.u = n
n.u = e
n.t = e
assert b.o.v.u.u.u.t.u.u.txt == "e"