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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

k = A("k")
e = B("e")
h = C("h")
j = D("j")
a = E("a")
d = F("d")
n = G("n")
l = H("l")
f = I("f")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

k = A("k")
e = B("e")
h = C("h")
j = D("j")
a = E("a")
d = F("d")
n = G("n")
l = H("l")
f = I("f")

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