class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: H = None
        self.s: D = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: I = None
        self.u: C = None
        self.x: G = None
        self.q: I = None
        self.w: E = None
        self.p: I = None
        self.v: E = None
        self.y: G = None
        self.z: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: D = None
        self.o: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: I = None
        self.u: C = None
        self.x: G = None
        self.q: I = None
        self.w: E = None
        self.p: I = None
        self.v: E = None
        self.y: G = None
        self.z: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: D = None
        self.o: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

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

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