class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: B = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: G = None
        self.p: F = None
        self.txt = txt

l = A("l")
g = B("g")
i = C("i")
e = D("e")
m = E("m")
a = F("a")
d = G("d")
c = F("c")
h = G("h")

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: G = None
        self.p: F = None
        self.txt = txt

l = A("l")
g = B("g")
i = C("i")
e = D("e")
m = E("m")
a = F("a")
d = G("d")
c = F("c")
h = G("h")

l.q = i
l.v = g
l.s = a
g.y = m
g.t = i
g.p = i
g.s = i
g.q = c
g.r = l
i.p = d
e.u = l
e.q = m
m.q = a
m.y = g
m.v = g
m.p = i
m.z = c
m.w = d
m.u = d
a.q = l
a.s = m
a.t = c
d.s = e
d.v = h
d.p = a
c.q = l
c.s = m
c.t = a
h.s = e
h.v = d
h.p = a
assert a.q.s.s.q.q.v.s.p.p.txt == "a"