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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: F = None
        self.w: D = None
        self.q: A = None
        self.x: C = None
        self.u: H = None
        self.y: G = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.x: A = None
        self.y: B = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: H = None
        self.q: D = None
        self.u: D = None
        self.w: B = None
        self.x: F = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: F = None
        self.w: D = None
        self.q: A = None
        self.x: C = None
        self.u: H = None
        self.y: G = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.x: A = None
        self.y: B = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: H = None
        self.q: D = None
        self.u: D = None
        self.w: B = None
        self.x: F = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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