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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: E = None
        self.txt = txt

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

i.r = l
i.o = l
i.q = h
i.s = d
l.q = h
l.p = i
l.r = f
l.u = d
l.o = n
h.q = f
d.s = n
f.u = d
f.z = b
f.p = i
f.s = i
f.o = i
f.q = i
f.w = n
e.q = f
e.y = f
e.z = l
e.s = l
e.p = n
e.u = b
e.w = h
e.o = h
n.q = h
n.y = e
b.p = h
b.z = f
assert d.s.y.s.q.q.u.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: C = None
        self.o: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: E = None
        self.txt = txt

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

i.r = l
i.o = l
i.q = h
i.s = d
l.q = h
l.p = i
l.r = f
l.u = d
l.o = n
h.q = f
d.s = n
f.u = d
f.z = b
f.p = i
f.s = i
f.o = i
f.q = i
f.w = n
e.q = f
e.y = f
e.z = l
e.s = l
e.p = n
e.u = b
e.w = h
e.o = h
n.q = h
n.y = e
b.p = h
b.z = f
assert d.s.y.s.q.q.u.s.q.txt == "h"