class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: B = None
        self.t: H = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: J = None
        self.t: E = None
        self.x: D = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: G = None
        self.z: J = None
        self.v: F = None
        self.y: C = None
        self.w: B = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: B = None
        self.p: J = None
        self.u: E = None
        self.q: D = None
        self.t: J = None
        self.v: A = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: J = None
        self.w: A = None
        self.v: B = None
        self.x: B = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: F = None
        self.s: F = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: A = None
        self.y: E = None
        self.z: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: I = None
        self.x: B = None
        self.w: I = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: J = None
        self.t: E = None
        self.x: D = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: G = None
        self.z: J = None
        self.v: F = None
        self.y: C = None
        self.w: B = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: B = None
        self.p: J = None
        self.u: E = None
        self.q: D = None
        self.t: J = None
        self.v: A = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: J = None
        self.w: A = None
        self.v: B = None
        self.x: B = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: F = None
        self.s: F = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: A = None
        self.y: E = None
        self.z: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: I = None
        self.x: B = None
        self.w: I = None
        self.v: B = None
        self.txt = txt

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

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