class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.q: I = None
        self.z: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: D = None
        self.y: J = None
        self.z: E = None
        self.p: C = None
        self.v: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: B = None
        self.y: H = None
        self.o: H = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: A = None
        self.y: C = None
        self.v: E = None
        self.o: G = None
        self.x: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.z: D = None
        self.q: G = None
        self.v: B = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.p: D = None
        self.z: D = None
        self.o: E = None
        self.v: J = None
        self.x: C = None
        self.u: A = None
        self.r: E = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: G = None
        self.q: D = None
        self.y: E = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: H = None
        self.txt = txt

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

k.w = i
k.t = i
k.q = b
k.z = b
n.q = l
n.v = l
n.x = m
n.y = e
n.z = h
n.u = h
n.p = i
i.w = h
i.x = n
i.y = f
i.o = f
i.v = f
m.w = h
m.v = h
m.z = k
m.y = i
m.o = a
m.x = e
h.w = i
h.p = m
h.z = m
h.q = a
h.v = n
h.y = b
l.v = k
l.p = h
l.t = m
a.q = i
a.y = i
a.x = i
a.p = m
a.z = m
a.o = h
a.r = h
a.v = e
a.u = k
a.t = f
f.v = k
b.x = n
b.p = a
b.q = m
b.y = h
b.v = f
e.w = b
e.t = f
assert h.z.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.q: I = None
        self.z: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: D = None
        self.y: J = None
        self.z: E = None
        self.p: C = None
        self.v: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: B = None
        self.y: H = None
        self.o: H = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: A = None
        self.y: C = None
        self.v: E = None
        self.o: G = None
        self.x: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.z: D = None
        self.q: G = None
        self.v: B = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.p: D = None
        self.z: D = None
        self.o: E = None
        self.v: J = None
        self.x: C = None
        self.u: A = None
        self.r: E = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: G = None
        self.q: D = None
        self.y: E = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: H = None
        self.txt = txt

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

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