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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: F = None
        self.o: G = None
        self.q: F = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: E = None
        self.y: B = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.w: H = None
        self.z: B = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: F = None
        self.o: G = None
        self.q: F = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: E = None
        self.y: B = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.w: H = None
        self.z: B = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: F = None
        self.txt = txt

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

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