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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: E = None
        self.x: E = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.t: F = None
        self.p: A = None
        self.z: F = None
        self.txt = txt

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

n = A("n")
k = B("k")
m = C("m")
l = D("l")
g = E("g")
i = F("i")
e = D("e")
a = D("a")
h = C("h")

n.w = k
n.t = k
n.s = k
n.x = i
k.s = h
m.s = a
m.z = g
m.x = g
m.v = i
l.x = i
l.w = g
g.w = i
g.t = i
g.z = i
g.o = e
g.p = n
i.v = g
i.w = n
i.u = n
i.z = l
i.p = m
i.r = k
e.x = i
e.w = g
a.x = i
a.w = g
h.s = e
h.z = g
h.x = g
h.v = i
assert g.z.z.x.p.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.x: F = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: E = None
        self.x: E = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.t: F = None
        self.p: A = None
        self.z: F = None
        self.txt = txt

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

n = A("n")
k = B("k")
m = C("m")
l = D("l")
g = E("g")
i = F("i")
e = D("e")
a = D("a")
h = C("h")

n.w = k
n.t = k
n.s = k
n.x = i
k.s = h
m.s = a
m.z = g
m.x = g
m.v = i
l.x = i
l.w = g
g.w = i
g.t = i
g.z = i
g.o = e
g.p = n
i.v = g
i.w = n
i.u = n
i.z = l
i.p = m
i.r = k
e.x = i
e.w = g
a.x = i
a.w = g
h.s = e
h.z = g
h.x = g
h.v = i
assert g.z.z.x.p.s.w.txt == "g"