class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: C = None
        self.x: G = None
        self.y: C = None
        self.v: G = None
        self.p: E = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: F = None
        self.x: A = None
        self.q: F = None
        self.z: F = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: F = None
        self.x: A = None
        self.q: F = None
        self.z: F = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

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

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