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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: F = None
        self.o: F = None
        self.x: D = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: F = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: F = None
        self.o: F = None
        self.x: D = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: F = None
        self.o: E = None
        self.txt = txt

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

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

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

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