class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: E = None
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: D = None
        self.v: H = None
        self.r: H = None
        self.z: E = None
        self.s: E = None
        self.p: F = None
        self.x: D = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: I = None
        self.p: F = None
        self.r: F = None
        self.q: G = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: G = None
        self.p: A = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: G = None
        self.s: I = None
        self.z: D = None
        self.p: I = None
        self.v: G = None
        self.x: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: D = None
        self.v: H = None
        self.r: H = None
        self.z: E = None
        self.s: E = None
        self.p: F = None
        self.x: D = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: I = None
        self.p: F = None
        self.r: F = None
        self.q: G = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: G = None
        self.p: A = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: G = None
        self.s: I = None
        self.z: D = None
        self.p: I = None
        self.v: G = None
        self.x: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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