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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: D = None
        self.s: C = None
        self.u: C = None
        self.v: C = None
        self.y: G = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: G = None
        self.r: E = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: E = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: E = None
        self.w: B = None
        self.v: C = None
        self.q: C = None
        self.y: F = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: D = None
        self.s: C = None
        self.u: C = None
        self.v: C = None
        self.y: G = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: G = None
        self.r: E = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: E = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: E = None
        self.w: B = None
        self.v: C = None
        self.q: C = None
        self.y: F = None
        self.p: B = None
        self.txt = txt

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

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