class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: G = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: C = None
        self.w: D = None
        self.t: C = None
        self.p: H = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: F = None
        self.s: H = None
        self.o: E = None
        self.p: E = None
        self.z: G = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: G = None
        self.o: A = None
        self.q: E = None
        self.r: A = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: C = None
        self.w: D = None
        self.t: C = None
        self.p: H = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: F = None
        self.s: H = None
        self.o: E = None
        self.p: E = None
        self.z: G = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: G = None
        self.o: A = None
        self.q: E = None
        self.r: A = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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