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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: B = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: A = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.s: I = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: B = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: A = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.s: I = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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