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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: D = None
        self.t: A = None
        self.s: A = None
        self.z: H = None
        self.v: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: C = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.t: C = None
        self.y: B = None
        self.v: E = None
        self.s: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: D = None
        self.t: A = None
        self.s: A = None
        self.z: H = None
        self.v: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: C = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.t: C = None
        self.y: B = None
        self.v: E = None
        self.s: D = None
        self.txt = txt

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

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