class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: A = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: B = None
        self.y: F = None
        self.v: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: A = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: B = None
        self.y: F = None
        self.v: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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