class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: B = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: E = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: G = None
        self.x: D = None
        self.s: D = None
        self.r: A = None
        self.w: A = None
        self.p: E = None
        self.y: F = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: E = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: G = None
        self.x: D = None
        self.s: D = None
        self.r: A = None
        self.w: A = None
        self.p: E = None
        self.y: F = None
        self.z: B = None
        self.txt = txt

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

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