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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: F = None
        self.x: F = None
        self.u: I = None
        self.r: H = None
        self.o: A = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: B = None
        self.r: G = None
        self.v: F = None
        self.w: E = None
        self.q: G = None
        self.u: B = None
        self.s: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: H = None
        self.q: H = None
        self.y: A = None
        self.t: F = None
        self.v: A = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: F = None
        self.x: F = None
        self.u: I = None
        self.r: H = None
        self.o: A = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: B = None
        self.r: G = None
        self.v: F = None
        self.w: E = None
        self.q: G = None
        self.u: B = None
        self.s: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: H = None
        self.q: H = None
        self.y: A = None
        self.t: F = None
        self.v: A = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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