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

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: D = None
        self.o: G = None
        self.u: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: B = None
        self.o: I = None
        self.p: F = None
        self.z: G = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: J = None
        self.w: H = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: F = None
        self.p: C = None
        self.s: H = None
        self.y: H = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: J = None
        self.q: B = None
        self.txt = txt

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

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

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

f.u = i
f.v = i
f.r = j
f.x = d
f.z = n
f.o = n
f.p = c
f.q = c
f.y = b
f.t = l
j.o = g
b.q = f
b.z = n
b.o = i
b.u = g
n.s = j
n.w = j
n.o = d
n.r = d
n.p = k
n.z = i
l.r = b
l.x = g
l.w = c
l.u = c
k.q = j
i.u = d
i.r = k
i.v = k
i.p = b
i.s = c
i.y = c
c.u = i
c.y = g
c.q = j
d.r = l
d.z = c
d.s = c
d.v = k
d.q = j
d.y = j
d.o = g
d.w = n
g.q = i
g.x = l
assert d.z.q.o.q.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: B = None
        self.x: I = None
        self.z: D = None
        self.p: H = None
        self.o: D = None
        self.y: C = None
        self.v: G = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: D = None
        self.o: G = None
        self.u: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: B = None
        self.o: I = None
        self.p: F = None
        self.z: G = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: J = None
        self.w: H = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: F = None
        self.p: C = None
        self.s: H = None
        self.y: H = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: J = None
        self.q: B = None
        self.txt = txt

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

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

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

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