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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.t: E = None
        self.x: F = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.o: A = None
        self.w: B = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.t: E = None
        self.x: F = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.o: A = None
        self.w: B = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

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

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

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