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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: C = None
        self.x: F = None
        self.r: E = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: C = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.p: C = None
        self.txt = txt

h = A("h")
g = B("g")
k = C("k")
i = D("i")
l = E("l")
f = F("f")
m = F("m")
a = B("a")
d = E("d")
n = A("n")

h.p = k
g.s = k
g.y = k
g.z = k
g.x = f
g.r = l
k.s = d
i.t = a
i.v = g
i.s = m
i.y = f
l.r = m
l.x = k
l.t = d
f.o = k
f.r = k
f.p = k
m.o = k
m.r = k
m.p = k
a.s = k
a.y = k
a.z = k
a.x = f
a.r = d
d.r = f
d.x = k
d.t = l
n.p = k
assert m.o.s.t.r.p.s.t.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: C = None
        self.x: F = None
        self.r: E = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: C = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.p: C = None
        self.txt = txt

h = A("h")
g = B("g")
k = C("k")
i = D("i")
l = E("l")
f = F("f")
m = F("m")
a = B("a")
d = E("d")
n = A("n")

h.p = k
g.s = k
g.y = k
g.z = k
g.x = f
g.r = l
k.s = d
i.t = a
i.v = g
i.s = m
i.y = f
l.r = m
l.x = k
l.t = d
f.o = k
f.r = k
f.p = k
m.o = k
m.r = k
m.p = k
a.s = k
a.y = k
a.z = k
a.x = f
a.r = d
d.r = f
d.x = k
d.t = l
n.p = k
assert m.o.s.t.r.p.s.t.r.o.txt == "k"