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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: A = None
        self.q: C = None
        self.r: G = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.y: E = None
        self.p: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: A = None
        self.q: C = None
        self.r: G = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.y: E = None
        self.p: D = None
        self.txt = txt

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

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

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