class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: A = None
        self.q: A = None
        self.r: G = None
        self.s: B = None
        self.o: G = None
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: F = None
        self.x: F = None
        self.u: A = None
        self.o: C = None
        self.q: C = None
        self.t: A = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: D = None
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: A = None
        self.q: A = None
        self.r: G = None
        self.s: B = None
        self.o: G = None
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: F = None
        self.x: F = None
        self.u: A = None
        self.o: C = None
        self.q: C = None
        self.t: A = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: D = None
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: C = None
        self.txt = txt

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

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

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