class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: C = None
        self.r: C = None
        self.q: A = None
        self.t: G = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: A = None
        self.o: D = None
        self.z: A = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: C = None
        self.r: C = None
        self.q: A = None
        self.t: G = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: A = None
        self.o: D = None
        self.z: A = None
        self.v: C = None
        self.txt = txt

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

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