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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: D = None
        self.t: E = None
        self.p: B = None
        self.w: B = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: J = None
        self.t: H = None
        self.o: I = None
        self.w: F = None
        self.q: H = None
        self.v: E = None
        self.z: I = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: I = None
        self.y: C = None
        self.u: J = None
        self.p: C = None
        self.r: A = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: E = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: E = None
        self.z: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: A = None
        self.p: I = None
        self.y: H = None
        self.w: B = None
        self.t: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: D = None
        self.t: E = None
        self.p: B = None
        self.w: B = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: J = None
        self.t: H = None
        self.o: I = None
        self.w: F = None
        self.q: H = None
        self.v: E = None
        self.z: I = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: I = None
        self.y: C = None
        self.u: J = None
        self.p: C = None
        self.r: A = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: E = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: E = None
        self.z: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: A = None
        self.p: I = None
        self.y: H = None
        self.w: B = None
        self.t: I = None
        self.txt = txt

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

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