class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: H = None
        self.w: C = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: I = None
        self.r: F = None
        self.v: D = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: A = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: H = None
        self.t: B = None
        self.s: D = None
        self.p: D = None
        self.u: G = None
        self.q: D = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: A = None
        self.o: B = None
        self.y: C = None
        self.q: D = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: B = None
        self.y: A = None
        self.o: B = None
        self.u: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: C = None
        self.u: F = None
        self.z: C = None
        self.o: E = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: I = None
        self.r: F = None
        self.v: D = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: A = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: H = None
        self.t: B = None
        self.s: D = None
        self.p: D = None
        self.u: G = None
        self.q: D = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: A = None
        self.o: B = None
        self.y: C = None
        self.q: D = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: B = None
        self.y: A = None
        self.o: B = None
        self.u: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: C = None
        self.u: F = None
        self.z: C = None
        self.o: E = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

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