class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.x: C = None
        self.y: F = None
        self.txt = txt

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

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

n = A("n")
j = B("j")
h = C("h")
a = D("a")
k = E("k")
m = F("m")
c = A("c")
f = D("f")
e = E("e")

n.x = c
n.z = k
n.s = m
j.x = f
j.q = c
h.s = e
h.z = n
h.p = c
a.s = c
a.p = m
a.y = m
a.x = h
k.p = n
k.r = h
k.y = a
m.o = j
m.t = e
c.x = n
c.z = k
c.s = m
f.s = n
f.p = m
f.y = m
f.x = h
e.p = n
e.r = h
e.y = f
assert e.r.z.x.s.t.y.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.x: C = None
        self.y: F = None
        self.txt = txt

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

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

n = A("n")
j = B("j")
h = C("h")
a = D("a")
k = E("k")
m = F("m")
c = A("c")
f = D("f")
e = E("e")

n.x = c
n.z = k
n.s = m
j.x = f
j.q = c
h.s = e
h.z = n
h.p = c
a.s = c
a.p = m
a.y = m
a.x = h
k.p = n
k.r = h
k.y = a
m.o = j
m.t = e
c.x = n
c.z = k
c.s = m
f.s = n
f.p = m
f.y = m
f.x = h
e.p = n
e.r = h
e.y = f
assert e.r.z.x.s.t.y.y.t.txt == "e"