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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: F = None
        self.s: I = None
        self.o: C = None
        self.t: H = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: A = None
        self.t: B = None
        self.q: B = None
        self.p: H = None
        self.z: B = None
        self.x: A = None
        self.o: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: F = None
        self.s: I = None
        self.o: C = None
        self.t: H = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: A = None
        self.t: B = None
        self.q: B = None
        self.p: H = None
        self.z: B = None
        self.x: A = None
        self.o: H = None
        self.txt = txt

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

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

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

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

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