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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: E = None
        self.u: A = None
        self.z: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: E = None
        self.u: A = None
        self.z: D = None
        self.q: A = None
        self.txt = txt

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

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