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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: D = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.v: A = None
        self.x: D = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: D = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.v: A = None
        self.x: D = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.q: F = None
        self.txt = txt

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

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