class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: E = None
        self.z: B = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: E = None
        self.z: B = None
        self.p: A = None
        self.txt = txt

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

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

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