class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.s: F = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: A = None
        self.o: D = None
        self.r: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: D = None
        self.p: G = None
        self.r: F = None
        self.z: B = None
        self.txt = txt

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

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

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

i = A("i")
l = B("l")
b = C("b")
d = D("d")
a = E("a")
k = F("k")
e = G("e")
m = H("m")
n = A("n")

i.p = e
i.r = e
i.s = k
i.w = k
l.y = e
l.u = i
l.o = d
l.r = d
b.w = i
d.w = e
d.p = a
d.z = a
a.y = i
a.o = d
a.p = e
a.r = k
a.z = l
k.s = a
k.p = d
e.x = m
e.r = k
m.v = n
n.p = e
n.r = e
n.s = k
n.w = k
assert e.x.v.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.s: F = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: A = None
        self.o: D = None
        self.r: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: D = None
        self.p: G = None
        self.r: F = None
        self.z: B = None
        self.txt = txt

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

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

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

i = A("i")
l = B("l")
b = C("b")
d = D("d")
a = E("a")
k = F("k")
e = G("e")
m = H("m")
n = A("n")

i.p = e
i.r = e
i.s = k
i.w = k
l.y = e
l.u = i
l.o = d
l.r = d
b.w = i
d.w = e
d.p = a
d.z = a
a.y = i
a.o = d
a.p = e
a.r = k
a.z = l
k.s = a
k.p = d
e.x = m
e.r = k
m.v = n
n.p = e
n.r = e
n.s = k
n.w = k
assert e.x.v.s.p.txt == "d"