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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: D = None
        self.r: I = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: H = None
        self.t: F = None
        self.x: B = None
        self.o: B = None
        self.v: G = None
        self.q: I = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: G = None
        self.q: I = None
        self.p: G = None
        self.r: G = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.x: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.v: F = None
        self.x: A = None
        self.r: A = None
        self.y: D = None
        self.u: A = None
        self.s: C = None
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: H = None
        self.u: A = None
        self.s: G = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: D = None
        self.r: I = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: H = None
        self.t: F = None
        self.x: B = None
        self.o: B = None
        self.v: G = None
        self.q: I = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: G = None
        self.q: I = None
        self.p: G = None
        self.r: G = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.x: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.v: F = None
        self.x: A = None
        self.r: A = None
        self.y: D = None
        self.u: A = None
        self.s: C = None
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: H = None
        self.u: A = None
        self.s: G = None
        self.v: B = None
        self.txt = txt

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

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