class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.o: H = None
        self.s: B = None
        self.x: B = None
        self.t: D = None
        self.u: H = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: J = None
        self.x: J = None
        self.t: G = None
        self.s: A = None
        self.w: B = None
        self.o: J = None
        self.r: B = None
        self.z: B = None
        self.p: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: G = None
        self.t: H = None
        self.y: D = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.u: I = None
        self.r: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: F = None
        self.u: C = None
        self.t: C = None
        self.s: I = None
        self.o: G = None
        self.x: A = None
        self.w: G = None
        self.q: C = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.z: C = None
        self.v: H = None
        self.t: A = None
        self.y: J = None
        self.q: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: B = None
        self.s: A = None
        self.v: C = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: J = None
        self.x: J = None
        self.t: G = None
        self.s: A = None
        self.w: B = None
        self.o: J = None
        self.r: B = None
        self.z: B = None
        self.p: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: G = None
        self.t: H = None
        self.y: D = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.u: I = None
        self.r: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: F = None
        self.u: C = None
        self.t: C = None
        self.s: I = None
        self.o: G = None
        self.x: A = None
        self.w: G = None
        self.q: C = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.z: C = None
        self.v: H = None
        self.t: A = None
        self.y: J = None
        self.q: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: B = None
        self.s: A = None
        self.v: C = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

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

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