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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: F = None
        self.q: D = None
        self.w: G = None
        self.v: F = None
        self.o: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: F = None
        self.q: D = None
        self.w: G = None
        self.v: F = None
        self.o: E = None
        self.u: E = None
        self.txt = txt

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

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