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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.w: H = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.r: H = None
        self.o: B = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: E = None
        self.x: A = None
        self.w: E = None
        self.t: G = None
        self.txt = txt

j = A("j")
e = B("e")
a = C("a")
i = D("i")
n = E("n")
c = F("c")
b = G("b")
d = H("d")
l = B("l")
m = A("m")

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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.w: H = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.r: H = None
        self.o: B = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: E = None
        self.x: A = None
        self.w: E = None
        self.t: G = None
        self.txt = txt

j = A("j")
e = B("e")
a = C("a")
i = D("i")
n = E("n")
c = F("c")
b = G("b")
d = H("d")
l = B("l")
m = A("m")

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