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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: D = None
        self.w: A = None
        self.o: A = None
        self.v: D = None
        self.txt = txt

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

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

j = A("j")
h = B("h")
l = C("l")
b = D("b")
k = E("k")
e = D("e")
d = B("d")

j.r = h
j.s = k
j.t = l
j.o = e
h.p = k
h.v = j
l.t = k
l.z = b
l.w = j
l.o = j
l.v = e
b.x = l
b.y = d
b.s = d
b.o = h
b.r = k
k.q = h
e.x = l
e.y = d
e.s = d
e.o = h
e.r = k
d.p = k
d.v = j
assert h.v.o.s.p.q.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: E = None
        self.t: C = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: D = None
        self.w: A = None
        self.o: A = None
        self.v: D = None
        self.txt = txt

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

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

j = A("j")
h = B("h")
l = C("l")
b = D("b")
k = E("k")
e = D("e")
d = B("d")

j.r = h
j.s = k
j.t = l
j.o = e
h.p = k
h.v = j
l.t = k
l.z = b
l.w = j
l.o = j
l.v = e
b.x = l
b.y = d
b.s = d
b.o = h
b.r = k
k.q = h
e.x = l
e.y = d
e.s = d
e.o = h
e.r = k
d.p = k
d.v = j
assert h.v.o.s.p.q.v.r.txt == "h"