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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: A = None
        self.z: F = None
        self.x: G = None
        self.t: F = None
        self.y: G = None
        self.u: H = None
        self.txt = txt

k = A("k")
h = B("h")
d = C("d")
f = D("f")
e = E("e")
b = F("b")
g = G("g")
c = H("c")
a = H("a")

k.u = f
k.z = e
k.t = b
k.o = g
h.x = b
h.q = d
h.p = d
h.s = d
h.y = f
h.w = f
d.z = b
d.w = k
d.y = f
d.x = g
f.y = b
f.q = b
e.t = b
e.r = d
e.q = g
b.s = d
b.t = h
g.t = d
g.x = b
c.q = e
c.r = k
c.z = b
c.t = b
c.x = g
c.y = g
c.u = a
a.q = e
a.r = k
a.z = b
a.t = b
a.x = g
a.y = g
a.u = c
assert f.q.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: E = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: A = None
        self.z: F = None
        self.x: G = None
        self.t: F = None
        self.y: G = None
        self.u: H = None
        self.txt = txt

k = A("k")
h = B("h")
d = C("d")
f = D("f")
e = E("e")
b = F("b")
g = G("g")
c = H("c")
a = H("a")

k.u = f
k.z = e
k.t = b
k.o = g
h.x = b
h.q = d
h.p = d
h.s = d
h.y = f
h.w = f
d.z = b
d.w = k
d.y = f
d.x = g
f.y = b
f.q = b
e.t = b
e.r = d
e.q = g
b.s = d
b.t = h
g.t = d
g.x = b
c.q = e
c.r = k
c.z = b
c.t = b
c.x = g
c.y = g
c.u = a
a.q = e
a.r = k
a.z = b
a.t = b
a.x = g
a.y = g
a.u = c
assert f.q.t.s.txt == "d"