class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: I = None
        self.r: D = None
        self.z: D = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.u: C = None
        self.p: C = None
        self.r: G = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: J = None
        self.r: B = None
        self.o: I = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.r: G = None
        self.z: I = None
        self.y: C = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: I = None
        self.r: D = None
        self.z: D = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.u: C = None
        self.p: C = None
        self.r: G = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: J = None
        self.r: B = None
        self.o: I = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.r: G = None
        self.z: I = None
        self.y: C = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

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

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