class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: G = None
        self.r: A = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: A = None
        self.q: D = None
        self.u: H = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: C = None
        self.y: F = None
        self.t: D = None
        self.v: A = None
        self.u: F = None
        self.txt = txt

d = A("d")
m = B("m")
l = C("l")
n = D("n")
h = E("h")
c = F("c")
k = G("k")
a = H("a")

d.z = h
m.v = n
m.p = k
m.u = k
m.r = d
l.x = d
n.y = h
n.u = h
n.q = h
n.z = c
n.t = k
n.x = d
n.r = l
h.u = m
h.q = m
h.w = l
h.y = d
h.x = d
h.p = n
c.w = l
c.q = l
c.y = l
c.o = a
c.r = k
c.u = k
c.s = d
c.z = h
k.s = h
k.o = h
k.r = h
k.x = d
k.q = n
k.u = a
a.q = k
a.o = l
a.y = c
a.u = c
a.t = n
a.v = d
assert k.u.o.x.z.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: G = None
        self.r: A = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: A = None
        self.q: D = None
        self.u: H = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: C = None
        self.y: F = None
        self.t: D = None
        self.v: A = None
        self.u: F = None
        self.txt = txt

d = A("d")
m = B("m")
l = C("l")
n = D("n")
h = E("h")
c = F("c")
k = G("k")
a = H("a")

d.z = h
m.v = n
m.p = k
m.u = k
m.r = d
l.x = d
n.y = h
n.u = h
n.q = h
n.z = c
n.t = k
n.x = d
n.r = l
h.u = m
h.q = m
h.w = l
h.y = d
h.x = d
h.p = n
c.w = l
c.q = l
c.y = l
c.o = a
c.r = k
c.u = k
c.s = d
c.z = h
k.s = h
k.o = h
k.r = h
k.x = d
k.q = n
k.u = a
a.q = k
a.o = l
a.y = c
a.u = c
a.t = n
a.v = d
assert k.u.o.x.z.w.x.txt == "d"