class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: B = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: E = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: E = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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