class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.z: G = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: G = None
        self.q: D = None
        self.x: D = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: D = None
        self.p: B = None
        self.r: A = None
        self.txt = txt

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

m = A("m")
h = B("h")
i = C("i")
j = D("j")
c = E("c")
k = F("k")
b = G("b")
d = G("d")
e = B("e")
g = E("g")

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: G = None
        self.q: D = None
        self.x: D = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: D = None
        self.p: B = None
        self.r: A = None
        self.txt = txt

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

m = A("m")
h = B("h")
i = C("i")
j = D("j")
c = E("c")
k = F("k")
b = G("b")
d = G("d")
e = B("e")
g = E("g")

m.y = j
m.o = h
m.z = b
m.u = b
h.t = c
h.u = c
h.o = d
h.q = j
h.x = j
h.z = g
i.t = k
j.v = k
j.r = m
c.v = m
k.w = j
k.v = j
k.p = e
k.r = m
b.w = j
b.z = g
d.w = j
d.z = g
e.t = c
e.u = c
e.o = b
e.q = j
e.x = j
e.z = g
g.v = m
assert b.z.v.o.o.z.v.o.txt == "h"