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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

h = A("h")
k = B("k")
d = C("d")
a = D("a")
n = E("n")
l = F("l")
b = C("b")
j = E("j")
e = B("e")
c = F("c")

h.v = c
k.p = j
k.r = d
k.u = h
k.y = n
d.z = a
a.t = h
n.z = h
n.v = b
n.r = d
n.u = a
l.u = c
l.w = b
b.z = a
j.z = h
j.v = d
j.r = b
j.u = a
e.p = j
e.r = d
e.u = h
e.y = n
c.u = l
c.w = d
assert n.v.z.t.v.w.z.t.v.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

h = A("h")
k = B("k")
d = C("d")
a = D("a")
n = E("n")
l = F("l")
b = C("b")
j = E("j")
e = B("e")
c = F("c")

h.v = c
k.p = j
k.r = d
k.u = h
k.y = n
d.z = a
a.t = h
n.z = h
n.v = b
n.r = d
n.u = a
l.u = c
l.w = b
b.z = a
j.z = h
j.v = d
j.r = b
j.u = a
e.p = j
e.r = d
e.u = h
e.y = n
c.u = l
c.w = d
assert n.v.z.t.v.w.z.t.v.w.z.txt == "a"