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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.u: F = None
        self.t: G = None
        self.y: G = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: G = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.u: F = None
        self.t: G = None
        self.y: G = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: G = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

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