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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.q: A = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.x: J = None
        self.v: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.v: E = None
        self.s: D = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.w: I = None
        self.o: G = None
        self.y: G = None
        self.q: I = None
        self.r: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.q: A = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.x: J = None
        self.v: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.v: E = None
        self.s: D = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.w: I = None
        self.o: G = None
        self.y: G = None
        self.q: I = None
        self.r: E = None
        self.txt = txt

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

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