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

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

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

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

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

a = A("a")
g = B("g")
d = C("d")
b = D("b")
n = E("n")
j = A("j")
k = B("k")

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

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

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

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

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

a = A("a")
g = B("g")
d = C("d")
b = D("b")
n = E("n")
j = A("j")
k = B("k")

a.x = d
a.o = n
a.y = n
a.s = j
a.z = b
g.x = a
g.q = d
g.u = d
g.p = k
d.x = g
d.y = b
d.p = b
d.q = j
b.v = d
b.x = d
b.u = k
n.y = d
n.t = d
n.x = d
n.p = k
j.x = d
j.o = n
j.y = n
j.s = a
j.z = b
k.x = a
k.q = d
k.u = d
k.p = g
assert j.s.s.y.y.txt == "d"