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

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

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

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

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

l = A("l")
m = B("m")
k = C("k")
c = D("c")
j = E("j")
d = A("d")
f = C("f")
e = C("e")

l.v = m
l.s = m
l.p = m
l.x = j
l.t = f
m.t = e
k.x = c
c.u = m
c.y = m
c.q = j
j.s = m
j.v = c
j.r = d
d.v = m
d.s = m
d.p = m
d.x = j
d.t = f
f.x = c
e.x = c
assert j.v.q.s.t.x.q.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.x: E = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

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

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

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

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

l = A("l")
m = B("m")
k = C("k")
c = D("c")
j = E("j")
d = A("d")
f = C("f")
e = C("e")

l.v = m
l.s = m
l.p = m
l.x = j
l.t = f
m.t = e
k.x = c
c.u = m
c.y = m
c.q = j
j.s = m
j.v = c
j.r = d
d.v = m
d.s = m
d.p = m
d.x = j
d.t = f
f.x = c
e.x = c
assert j.v.q.s.t.x.q.v.q.txt == "j"