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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: D = None
        self.p: H = None
        self.x: D = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: C = None
        self.v: B = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: A = None
        self.x: B = None
        self.q: A = None
        self.y: G = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: B = None
        self.w: E = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: G = None
        self.t: B = None
        self.y: C = None
        self.x: H = None
        self.txt = txt

h = A("h")
m = B("m")
i = C("i")
k = D("k")
l = E("l")
c = F("c")
j = G("j")
f = H("f")
n = H("n")
g = B("g")

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: D = None
        self.p: H = None
        self.x: D = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: C = None
        self.v: B = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: A = None
        self.x: B = None
        self.q: A = None
        self.y: G = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: B = None
        self.w: E = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: G = None
        self.t: B = None
        self.y: C = None
        self.x: H = None
        self.txt = txt

h = A("h")
m = B("m")
i = C("i")
k = D("k")
l = E("l")
c = F("c")
j = G("j")
f = H("f")
n = H("n")
g = B("g")

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