class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.z: D = None
        self.p: D = None
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

e = A("e")
b = B("b")
i = C("i")
n = D("n")
g = E("g")
l = B("l")
j = C("j")

e.y = n
e.z = n
e.p = n
e.s = j
e.q = i
b.t = e
b.x = l
b.s = i
b.o = j
b.w = n
i.p = l
i.v = e
n.q = b
g.x = l
g.z = l
g.u = l
l.t = e
l.x = b
l.s = j
l.o = j
l.w = n
j.p = b
j.v = e
assert j.v.z.q.o.v.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.z: D = None
        self.p: D = None
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

e = A("e")
b = B("b")
i = C("i")
n = D("n")
g = E("g")
l = B("l")
j = C("j")

e.y = n
e.z = n
e.p = n
e.s = j
e.q = i
b.t = e
b.x = l
b.s = i
b.o = j
b.w = n
i.p = l
i.v = e
n.q = b
g.x = l
g.z = l
g.u = l
l.t = e
l.x = b
l.s = j
l.o = j
l.w = n
j.p = b
j.v = e
assert j.v.z.q.o.v.s.p.txt == "b"