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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: B = None
        self.w: A = None
        self.q: A = None
        self.s: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: H = None
        self.z: C = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: B = None
        self.w: A = None
        self.q: A = None
        self.s: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: H = None
        self.z: C = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.txt = txt

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

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