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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: B = None
        self.r: D = None
        self.x: A = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.y: B = None
        self.r: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: B = None
        self.r: D = None
        self.x: A = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.y: B = None
        self.r: A = None
        self.txt = txt

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

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

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