class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: F = 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.p: E = None
        self.s: C = None
        self.r: C = None
        self.z: F = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.z: D = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: A = None
        self.p: E = None
        self.z: C = None
        self.x: D = None
        self.w: A = None
        self.txt = txt

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

a = A("a")
i = B("i")
e = C("e")
l = D("l")
n = E("n")
b = F("b")
c = G("c")
f = F("f")
g = C("g")

a.q = e
a.x = f
i.r = c
e.p = n
e.s = g
e.r = g
e.z = f
e.u = c
l.q = f
l.r = e
l.t = e
l.s = n
l.v = n
l.p = c
l.z = i
n.q = g
n.t = i
n.z = l
n.w = l
b.s = l
b.x = l
b.t = a
b.w = a
b.p = n
b.z = e
c.s = b
c.t = a
c.w = i
f.s = l
f.x = l
f.t = a
f.w = a
f.p = n
f.z = g
g.p = n
g.s = e
g.r = e
g.z = f
g.u = c
assert f.s.v.q.p.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: F = 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.p: E = None
        self.s: C = None
        self.r: C = None
        self.z: F = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.z: D = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: A = None
        self.p: E = None
        self.z: C = None
        self.x: D = None
        self.w: A = None
        self.txt = txt

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

a = A("a")
i = B("i")
e = C("e")
l = D("l")
n = E("n")
b = F("b")
c = G("c")
f = F("f")
g = C("g")

a.q = e
a.x = f
i.r = c
e.p = n
e.s = g
e.r = g
e.z = f
e.u = c
l.q = f
l.r = e
l.t = e
l.s = n
l.v = n
l.p = c
l.z = i
n.q = g
n.t = i
n.z = l
n.w = l
b.s = l
b.x = l
b.t = a
b.w = a
b.p = n
b.z = e
c.s = b
c.t = a
c.w = i
f.s = l
f.x = l
f.t = a
f.w = a
f.p = n
f.z = g
g.p = n
g.s = e
g.r = e
g.z = f
g.u = c
assert f.s.v.q.p.q.u.txt == "c"