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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: C = None
        self.w: C = None
        self.t: B = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: A = None
        self.u: F = None
        self.t: D = None
        self.s: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: A = None
        self.u: C = None
        self.o: G = None
        self.z: C = None
        self.x: C = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: C = None
        self.w: C = None
        self.t: B = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: A = None
        self.u: F = None
        self.t: D = None
        self.s: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: A = None
        self.u: C = None
        self.o: G = None
        self.z: C = None
        self.x: C = None
        self.v: D = None
        self.txt = txt

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

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