class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: D = None
        self.u: B = None
        self.o: E = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: C = None
        self.w: H = None
        self.r: I = None
        self.s: H = None
        self.z: F = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: D = None
        self.o: G = None
        self.w: F = None
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: E = None
        self.t: E = None
        self.u: D = None
        self.v: I = None
        self.x: C = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: B = None
        self.o: C = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: A = None
        self.t: C = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: C = None
        self.w: H = None
        self.r: I = None
        self.s: H = None
        self.z: F = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: D = None
        self.o: G = None
        self.w: F = None
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: E = None
        self.t: E = None
        self.u: D = None
        self.v: I = None
        self.x: C = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: B = None
        self.o: C = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: A = None
        self.t: C = None
        self.o: B = None
        self.txt = txt

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

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