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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.r: D = None
        self.u: H = None
        self.t: E = None
        self.w: B = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: D = None
        self.z: G = None
        self.r: C = None
        self.u: D = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.y: I = None
        self.p: C = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: G = None
        self.q: E = None
        self.y: H = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.r: D = None
        self.u: H = None
        self.t: E = None
        self.w: B = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: D = None
        self.z: G = None
        self.r: C = None
        self.u: D = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.y: I = None
        self.p: C = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: G = None
        self.q: E = None
        self.y: H = None
        self.w: F = None
        self.txt = txt

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

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

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