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

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

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

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

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

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

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

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

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

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

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

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

i.r = m
i.v = g
k.y = d
k.w = n
k.z = a
k.t = i
m.t = a
m.u = a
m.s = g
m.y = n
m.r = j
j.s = m
j.t = a
d.w = h
h.w = n
e.r = a
e.v = i
a.t = m
a.u = m
a.s = i
a.y = n
a.r = j
g.r = m
g.v = i
n.w = h
assert j.s.y.w.w.txt == "n"