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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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