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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

n.v = f
n.w = a
m.t = h
m.v = f
m.x = b
e.z = l
e.q = n
j.r = b
j.t = c
h.q = a
f.v = n
f.r = h
f.z = h
f.y = l
b.v = f
b.w = a
a.v = n
a.r = c
a.y = l
a.z = h
l.t = c
l.v = a
l.x = n
c.q = a
assert h.q.z.q.z.q.y.t.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

n.v = f
n.w = a
m.t = h
m.v = f
m.x = b
e.z = l
e.q = n
j.r = b
j.t = c
h.q = a
f.v = n
f.r = h
f.z = h
f.y = l
b.v = f
b.w = a
a.v = n
a.r = c
a.y = l
a.z = h
l.t = c
l.v = a
l.x = n
c.q = a
assert h.q.z.q.z.q.y.t.q.y.txt == "l"