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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: A = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: E = None
        self.txt = txt

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

l.t = k
l.s = k
l.u = c
l.v = c
b.x = m
c.t = e
m.r = e
m.s = l
m.w = l
m.y = b
e.r = l
e.q = f
k.t = l
k.s = l
k.u = i
k.v = c
f.r = l
f.q = e
i.t = f
assert k.s.t.v.t.r.u.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: C = None
        self.s: A = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: A = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: E = None
        self.txt = txt

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

l.t = k
l.s = k
l.u = c
l.v = c
b.x = m
c.t = e
m.r = e
m.s = l
m.w = l
m.y = b
e.r = l
e.q = f
k.t = l
k.s = l
k.u = i
k.v = c
f.r = l
f.q = e
i.t = f
assert k.s.t.v.t.r.u.t.r.txt == "l"