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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: G = None
        self.q: E = None
        self.x: A = None
        self.o: G = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: E = None
        self.z: A = None
        self.p: J = None
        self.q: F = None
        self.w: B = None
        self.y: B = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: E = None
        self.o: G = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: F = None
        self.p: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.p: J = None
        self.t: J = None
        self.r: D = None
        self.txt = txt

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

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

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

g = A("g")
i = B("i")
a = C("a")
l = D("l")
c = E("c")
m = F("m")
h = G("h")
d = H("d")
k = I("k")
b = J("b")

g.q = m
g.p = m
g.t = k
g.v = a
g.z = a
g.s = a
g.x = h
g.r = h
g.o = d
i.p = g
i.x = g
i.u = h
i.o = h
i.v = h
i.q = c
a.o = i
a.w = i
a.y = i
a.v = c
a.z = g
a.p = b
a.q = m
a.t = h
l.x = g
l.s = c
l.o = h
l.p = a
c.z = i
c.w = m
c.p = k
m.r = h
h.z = m
h.q = a
h.p = b
h.t = b
h.r = l
d.q = b
k.t = l
k.r = l
k.x = h
k.w = b
b.o = h
assert k.r.o.r.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: I = None
        self.v: C = None
        self.p: F = None
        self.z: C = None
        self.x: G = None
        self.o: H = None
        self.s: C = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: G = None
        self.q: E = None
        self.x: A = None
        self.o: G = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: E = None
        self.z: A = None
        self.p: J = None
        self.q: F = None
        self.w: B = None
        self.y: B = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: E = None
        self.o: G = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: F = None
        self.p: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.p: J = None
        self.t: J = None
        self.r: D = None
        self.txt = txt

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

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

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

g = A("g")
i = B("i")
a = C("a")
l = D("l")
c = E("c")
m = F("m")
h = G("h")
d = H("d")
k = I("k")
b = J("b")

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