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

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

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

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: C = None
        self.x: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: C = None
        self.x: C = None
        self.t: D = None
        self.txt = txt

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

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

j.y = i
j.t = i
j.p = i
j.s = g
g.q = n
g.y = e
i.z = a
i.r = j
i.p = e
i.t = e
i.q = g
a.v = n
a.t = n
a.o = i
a.x = i
e.o = j
e.r = j
e.q = g
e.p = i
n.v = a
n.t = a
n.o = i
n.x = i
assert g.y.r.p.p.o.txt == "j"