class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: E = None
        self.s: H = None
        self.u: D = None
        self.v: H = None
        self.w: D = None
        self.x: F = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: G = None
        self.y: B = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: C = None
        self.t: C = None
        self.r: C = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: G = None
        self.u: C = None
        self.o: G = None
        self.t: B = None
        self.r: H = None
        self.p: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: C = None
        self.x: B = None
        self.r: B = None
        self.s: B = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: G = None
        self.y: B = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: C = None
        self.t: C = None
        self.r: C = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: G = None
        self.u: C = None
        self.o: G = None
        self.t: B = None
        self.r: H = None
        self.p: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: C = None
        self.x: B = None
        self.r: B = None
        self.s: B = None
        self.p: D = None
        self.txt = txt

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

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