class A:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: B = None
        self.y: D = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.p: J = None
        self.q: A = None
        self.o: G = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: E = None
        self.q: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: E = None
        self.p: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: G = None
        self.v: F = None
        self.x: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.p: J = None
        self.q: A = None
        self.o: G = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: E = None
        self.q: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: E = None
        self.p: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: G = None
        self.v: F = None
        self.x: G = None
        self.txt = txt

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

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