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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: C = None
        self.s: E = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

d.x = n
d.u = n
d.r = m
d.z = m
a.x = m
a.y = m
a.w = n
a.s = e
a.v = d
n.w = g
n.v = g
n.p = a
g.y = d
g.s = n
g.u = j
e.q = g
e.v = a
e.s = a
e.z = k
j.q = g
j.v = a
j.s = a
j.z = k
k.q = g
k.v = a
k.s = a
k.z = e
m.x = n
m.u = n
m.r = d
m.z = d
assert j.s.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: C = None
        self.s: E = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

d.x = n
d.u = n
d.r = m
d.z = m
a.x = m
a.y = m
a.w = n
a.s = e
a.v = d
n.w = g
n.v = g
n.p = a
g.y = d
g.s = n
g.u = j
e.q = g
e.v = a
e.s = a
e.z = k
j.q = g
j.v = a
j.s = a
j.z = k
k.q = g
k.v = a
k.s = a
k.z = e
m.x = n
m.u = n
m.r = d
m.z = d
assert j.s.w.w.txt == "g"