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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: F = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: C = None
        self.p: D = None
        self.txt = txt

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

i = A("i")
b = B("b")
d = C("d")
m = D("m")
f = E("f")
j = F("j")
a = G("a")
l = H("l")
g = D("g")
k = E("k")

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: F = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: C = None
        self.p: D = None
        self.txt = txt

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

i = A("i")
b = B("b")
d = C("d")
m = D("m")
f = E("f")
j = F("j")
a = G("a")
l = H("l")
g = D("g")
k = E("k")

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