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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: G = None
        self.s: D = None
        self.u: F = None
        self.w: D = None
        self.o: D = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: H = None
        self.z: E = None
        self.s: F = None
        self.o: E = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: A = None
        self.p: C = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: G = None
        self.s: D = None
        self.u: F = None
        self.w: D = None
        self.o: D = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: H = None
        self.z: E = None
        self.s: F = None
        self.o: E = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: A = None
        self.p: C = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

g.o = f
g.z = f
g.q = d
n.q = f
n.y = f
n.s = c
n.w = c
n.o = c
n.x = c
n.u = l
m.o = d
c.y = a
c.q = a
c.z = d
c.o = d
c.s = l
c.u = n
d.u = a
d.q = g
d.p = m
d.z = m
d.o = f
b.w = g
b.s = g
b.p = a
b.q = n
f.t = m
a.t = g
i.w = g
i.s = g
i.p = a
i.q = n
l.w = g
l.s = g
l.p = a
l.q = n
assert c.q.t.o.t.o.q.txt == "g"