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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: B = None
        self.u: D = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: B = None
        self.p: C = None
        self.y: G = None
        self.txt = txt

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

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

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

i.q = c
i.r = b
i.p = f
a.z = h
c.v = a
c.p = a
c.u = m
c.q = h
m.s = i
g.v = c
g.p = c
g.u = a
g.y = k
b.z = l
b.w = l
b.r = a
b.p = a
b.x = i
b.v = m
b.y = m
k.y = a
k.q = a
k.r = m
k.u = h
h.y = a
h.q = a
h.r = m
h.u = k
f.z = l
f.w = l
f.r = a
f.p = a
f.x = i
f.v = m
f.y = m
l.v = c
l.p = c
l.u = a
l.y = h
assert f.w.u.z.q.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: F = None
        self.p: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: B = None
        self.u: D = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: B = None
        self.p: C = None
        self.y: G = None
        self.txt = txt

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

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

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

i.q = c
i.r = b
i.p = f
a.z = h
c.v = a
c.p = a
c.u = m
c.q = h
m.s = i
g.v = c
g.p = c
g.u = a
g.y = k
b.z = l
b.w = l
b.r = a
b.p = a
b.x = i
b.v = m
b.y = m
k.y = a
k.q = a
k.r = m
k.u = h
h.y = a
h.q = a
h.r = m
h.u = k
f.z = l
f.w = l
f.r = a
f.p = a
f.x = i
f.v = m
f.y = m
l.v = c
l.p = c
l.u = a
l.y = h
assert f.w.u.z.q.z.r.txt == "m"