class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: G = None
        self.t: H = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: B = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: G = None
        self.t: H = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: B = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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