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

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

class C:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: D = None
        self.y: J = None
        self.q: H = None
        self.r: B = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: E = None
        self.s: E = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: G = None
        self.o: J = None
        self.r: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.r: A = None
        self.t: E = None
        self.q: E = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: F = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: D = None
        self.y: J = None
        self.q: H = None
        self.r: B = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: E = None
        self.s: E = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: G = None
        self.o: J = None
        self.r: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.r: A = None
        self.t: E = None
        self.q: E = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: F = None
        self.w: F = None
        self.txt = txt

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

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

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

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