class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.q: E = None
        self.y: B = None
        self.x: E = None
        self.txt = txt

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

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

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

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

n = A("n")
i = B("i")
l = C("l")
c = D("c")
j = E("j")
m = C("m")
g = A("g")
d = B("d")
a = E("a")

n.r = g
n.t = g
n.q = j
n.x = j
n.y = d
i.y = c
i.o = c
i.v = c
i.s = n
l.o = n
l.x = c
l.p = i
l.r = g
c.u = i
j.z = c
j.w = c
j.x = a
m.o = n
m.x = c
m.p = d
m.r = g
g.r = n
g.t = n
g.q = a
g.x = a
g.y = i
d.y = c
d.o = c
d.v = c
d.s = n
a.z = c
a.w = c
a.x = j
assert j.x.x.w.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.q: E = None
        self.y: B = None
        self.x: E = None
        self.txt = txt

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

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

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

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

n = A("n")
i = B("i")
l = C("l")
c = D("c")
j = E("j")
m = C("m")
g = A("g")
d = B("d")
a = E("a")

n.r = g
n.t = g
n.q = j
n.x = j
n.y = d
i.y = c
i.o = c
i.v = c
i.s = n
l.o = n
l.x = c
l.p = i
l.r = g
c.u = i
j.z = c
j.w = c
j.x = a
m.o = n
m.x = c
m.p = d
m.r = g
g.r = n
g.t = n
g.q = a
g.x = a
g.y = i
d.y = c
d.o = c
d.v = c
d.s = n
a.z = c
a.w = c
a.x = j
assert j.x.x.w.u.s.txt == "n"