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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: H = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: A = None
        self.t: A = None
        self.v: E = None
        self.q: D = None
        self.o: A = None
        self.x: F = None
        self.y: E = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: H = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: A = None
        self.t: A = None
        self.v: E = None
        self.q: D = None
        self.o: A = None
        self.x: F = None
        self.y: E = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: C = None
        self.txt = txt

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

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