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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: D = None
        self.p: E = None
        self.u: A = None
        self.r: B = None
        self.z: F = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: A = None
        self.t: G = None
        self.v: B = None
        self.u: E = None
        self.o: G = None
        self.y: A = None
        self.txt = txt

a = A("a")
j = B("j")
n = C("n")
i = D("i")
g = E("g")
l = F("l")
c = G("c")
d = H("d")
f = B("f")

a.s = j
j.r = i
j.z = a
j.o = a
j.s = f
j.x = g
j.q = d
j.y = n
n.z = g
i.x = d
g.x = d
l.s = n
l.y = j
c.o = d
c.y = i
c.v = i
c.p = g
c.u = a
c.r = f
c.z = l
d.z = c
d.t = c
d.o = c
d.s = a
d.y = a
d.v = f
d.u = g
f.r = i
f.z = a
f.o = a
f.s = j
f.x = g
f.q = d
f.y = n
assert d.v.s.o.s.q.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: D = None
        self.p: E = None
        self.u: A = None
        self.r: B = None
        self.z: F = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: A = None
        self.t: G = None
        self.v: B = None
        self.u: E = None
        self.o: G = None
        self.y: A = None
        self.txt = txt

a = A("a")
j = B("j")
n = C("n")
i = D("i")
g = E("g")
l = F("l")
c = G("c")
d = H("d")
f = B("f")

a.s = j
j.r = i
j.z = a
j.o = a
j.s = f
j.x = g
j.q = d
j.y = n
n.z = g
i.x = d
g.x = d
l.s = n
l.y = j
c.o = d
c.y = i
c.v = i
c.p = g
c.u = a
c.r = f
c.z = l
d.z = c
d.t = c
d.o = c
d.s = a
d.y = a
d.v = f
d.u = g
f.r = i
f.z = a
f.o = a
f.s = j
f.x = g
f.q = d
f.y = n
assert d.v.s.o.s.q.o.v.txt == "i"