class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: D = None
        self.t: C = None
        self.p: F = None
        self.v: D = None
        self.s: F = None
        self.u: D = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: H = None
        self.r: G = None
        self.t: E = None
        self.y: C = None
        self.p: F = None
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: G = None
        self.u: B = None
        self.y: D = None
        self.x: C = None
        self.w: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.s: I = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: H = None
        self.r: G = None
        self.t: E = None
        self.y: C = None
        self.p: F = None
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: G = None
        self.u: B = None
        self.y: D = None
        self.x: C = None
        self.w: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.s: I = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.txt = txt

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

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