class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: F = None
        self.v: G = None
        self.q: F = None
        self.s: G = None
        self.p: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: H = None
        self.s: B = None
        self.o: E = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: A = None
        self.x: B = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: H = None
        self.s: B = None
        self.o: E = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: A = None
        self.x: B = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: G = None
        self.txt = txt

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

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

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