class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: E = None
        self.v: C = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: D = None
        self.z: F = None
        self.s: B = None
        self.q: E = None
        self.o: E = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: 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.s: A = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: A = None
        self.t: A = None
        self.q: A = None
        self.w: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: D = None
        self.z: F = None
        self.s: B = None
        self.q: E = None
        self.o: E = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: 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.s: A = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: A = None
        self.t: A = None
        self.q: A = None
        self.w: B = None
        self.txt = txt

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

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