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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: A = None
        self.o: C = None
        self.txt = txt

j = A("j")
k = B("k")
n = C("n")
i = D("i")
c = E("c")
f = E("f")
e = D("e")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: A = None
        self.o: C = None
        self.txt = txt

j = A("j")
k = B("k")
n = C("n")
i = D("i")
c = E("c")
f = E("f")
e = D("e")

j.y = e
j.q = e
j.p = n
k.s = j
k.z = j
k.v = f
k.r = n
k.p = c
n.o = i
n.p = i
n.w = j
n.y = k
n.t = f
i.x = j
i.q = j
i.v = k
i.p = k
c.z = f
c.q = j
c.o = n
f.z = c
f.q = j
f.o = n
e.x = j
e.q = j
e.v = k
e.p = k
assert e.p.r.w.p.w.y.v.txt == "k"