class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.r: E = None
        self.q: C = None
        self.v: C = None
        self.t: E = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.x: E = None
        self.w: D = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: E = None
        self.o: A = None
        self.w: C = None
        self.z: B = None
        self.x: D = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: B = None
        self.z: F = None
        self.x: D = None
        self.txt = txt

i = A("i")
h = B("h")
n = C("n")
m = D("m")
a = E("a")
k = F("k")
b = G("b")
c = G("c")

i.s = n
i.q = n
i.v = n
i.o = m
i.r = a
i.t = a
i.w = c
h.o = b
n.q = k
n.t = k
n.o = m
n.w = m
n.x = a
m.o = a
m.z = h
a.r = m
k.s = i
k.o = i
k.p = a
k.w = n
k.z = h
k.x = m
k.u = b
b.s = h
b.q = h
b.z = k
b.x = m
c.s = h
c.q = h
c.z = k
c.x = m
assert n.x.r.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.r: E = None
        self.q: C = None
        self.v: C = None
        self.t: E = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.x: E = None
        self.w: D = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: E = None
        self.o: A = None
        self.w: C = None
        self.z: B = None
        self.x: D = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: B = None
        self.z: F = None
        self.x: D = None
        self.txt = txt

i = A("i")
h = B("h")
n = C("n")
m = D("m")
a = E("a")
k = F("k")
b = G("b")
c = G("c")

i.s = n
i.q = n
i.v = n
i.o = m
i.r = a
i.t = a
i.w = c
h.o = b
n.q = k
n.t = k
n.o = m
n.w = m
n.x = a
m.o = a
m.z = h
a.r = m
k.s = i
k.o = i
k.p = a
k.w = n
k.z = h
k.x = m
k.u = b
b.s = h
b.q = h
b.z = k
b.x = m
c.s = h
c.q = h
c.z = k
c.x = m
assert n.x.r.o.r.txt == "m"