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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: I = None
        self.s: A = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.w: D = None
        self.t: G = None
        self.z: G = None
        self.x: E = None
        self.y: G = None
        self.u: I = None
        self.s: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: D = None
        self.t: E = None
        self.q: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: I = None
        self.s: A = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.w: D = None
        self.t: G = None
        self.z: G = None
        self.x: E = None
        self.y: G = None
        self.u: I = None
        self.s: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: D = None
        self.t: E = None
        self.q: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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