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

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

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

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

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

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

l.u = j
l.v = f
b.y = c
b.t = j
j.v = b
j.t = f
n.y = j
n.r = f
f.t = l
f.o = b
f.u = b
f.r = b
f.y = j
a.t = l
a.o = b
a.u = b
a.r = b
a.y = j
h.y = j
h.r = a
c.y = j
c.r = f
m.y = j
m.r = f
assert a.t.u.v.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

l.u = j
l.v = f
b.y = c
b.t = j
j.v = b
j.t = f
n.y = j
n.r = f
f.t = l
f.o = b
f.u = b
f.r = b
f.y = j
a.t = l
a.o = b
a.u = b
a.r = b
a.y = j
h.y = j
h.r = a
c.y = j
c.r = f
m.y = j
m.r = f
assert a.t.u.v.t.v.txt == "b"