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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: A = None
        self.q: F = None
        self.x: E = None
        self.z: A = None
        self.v: E = None
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: A = None
        self.q: F = None
        self.x: E = None
        self.z: A = None
        self.v: E = None
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

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