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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: G = None
        self.x: H = None
        self.o: I = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: H = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: E = None
        self.o: G = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: G = None
        self.x: H = None
        self.o: I = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: H = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: E = None
        self.o: G = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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