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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: D = None
        self.v: D = None
        self.w: D = None
        self.q: D = None
        self.txt = txt

j = A("j")
d = B("d")
e = C("e")
i = D("i")
f = E("f")
b = A("b")
n = D("n")
a = A("a")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: D = None
        self.v: D = None
        self.w: D = None
        self.q: D = None
        self.txt = txt

j = A("j")
d = B("d")
e = C("e")
i = D("i")
f = E("f")
b = A("b")
n = D("n")
a = A("a")

j.y = d
j.o = e
d.v = a
e.r = b
e.x = j
e.p = j
e.z = i
i.v = d
i.u = d
i.t = f
i.p = n
f.s = e
f.x = i
f.v = i
f.q = i
f.w = n
b.y = d
b.o = e
n.v = d
n.u = d
n.t = f
n.p = i
a.y = d
a.o = e
assert j.y.v.y.v.y.txt == "d"